package com.net.jef.webx.fen.common.webx.uri;

import java.util.Map;

import com.alibaba.citrus.turbine.uribroker.uri.TurbineURIBroker;

public class MessageFormatURIBroker extends TurbineURIBroker {

    @Override
    public String toString() {
        String superResult = super.toString();
        String[] strs= superResult.split("\\?");
        if(strs.length>1){
            String result = strs[0];
            Map<String, Object> params=  super.getQuery();
            for(Map.Entry<String, Object>entry :  params.entrySet()){
                
                result=result.replaceFirst("("+entry.getKey()+")", (String) entry.getValue());
               
            }
            return result;
            
        }else{
            return superResult;
        }
        
        
    }
    
    
   public static void     main(String[] a){
       String ss="aa?bb";
       System.out.println(ss.split("\\?")[1]);
   }
}
